package com.stoken.service.impl;

import java.util.Calendar;
import java.util.Date;

/**
 * 记录项目交易规则，常量
 * @author Frzhao
 *
 */
public class StokenRule {
	/**
	 * 提现手续费
	 */
	public final static Double WITHDRAWALSFEE = 0.10;
	
	/**
	 * 奖金手续费
	 */
	public final static Double CONSUMPTION_WITHDRAWALSFEE = 0.15;
	
	//提现状态描述
	/**
	 * 提现未处理
	 */
	public final static int EXTRACTSTATE_UNTREATED = 0;
	/**
	 * 提现处理成功
	 */
	public final static int EXTRACTSTATE_SUCCESS = 1;
	
	/**
	 * 提现处理失败
	 */
	public final static int EXTRACTSTATE_FAILURE = 2;
	
	/**
	 * 提现最少金额
	 */
	public final static int min_APPLYCASH = 500;
	
	public static Date getCalculateBonusDate(){
		  Calendar calendar = Calendar.getInstance();
	      int year = calendar.get(Calendar.YEAR);
	      int month = calendar.get(Calendar.MONTH);
	      int date = calendar.get(Calendar.DAY_OF_MONTH);		
	      int hour = calendar.get(Calendar.HOUR_OF_DAY);
//	      if((hour >= 0) && (hour< 8)){
//	    	  date = date-1;
//	      }
	      calendar.set(year, month, date);
		  return calendar.getTime();
		
	}
	
	public static int getHourNow(){
	    Calendar calendar = Calendar.getInstance();
	    int hour = calendar.get(Calendar.HOUR_OF_DAY);
	    return hour;
	}
	
	public static void main(String[] args) {
		getCalculateBonusDate();
	}
	
}
